package com.example.zhuma;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;

import androidx.appcompat.app.AppCompatActivity;

public class LoginActivity extends AppCompatActivity {
    String username="";
    String password="";
    boolean tag=true;
    int i=60;
    Button login_btn;
    Button forget_btn;
    ImageButton back_btn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        //去除上方导航框
        if (getSupportActionBar() != null) {
            getSupportActionBar().hide();
        }
        login_btn=(Button) findViewById(R.id.login_btn);
        login_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                EditText editText=(EditText)findViewById(R.id.username_edit);
                username=editText.getText().toString();
                EditText editText1=(EditText)findViewById(R.id.password_edit);
                password=editText1.getText().toString();
                if(username.equals("123456")&&password.equals("123456"))
                {
                    System.out.println("账号密码正确");
                    Intent intent=new Intent();
                    intent.setClass(LoginActivity.this, MainActivity.class);
                    startActivity(intent);
                }
            }
        });
    }
}
